package com.shr.xsunmvc.db.util;

public class Db2ObjectChangeUtil {
//	public static final Db2ObjectChangeUtil me = new Db2ObjectChangeUtil();

	public static String hump2Underline(String name) {
		StringBuffer sb = new StringBuffer(name) ;
		for(int i = sb.length() - 1; i >= 0; i--){
			if(Character.isUpperCase((sb.charAt(i)))){
				sb.setCharAt(i, Character.toLowerCase(sb.charAt(i)));
				sb.insert(i, "_") ;
			}
		}
		return sb.toString() ;
	}

	public static String change2GetMethodName(String name) {
		StringBuffer sb = new StringBuffer(name) ;
		sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
		return sb.insert(0, "get").toString() ;
	}
	
	
	
}
